<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;

class CreateNavsTable extends Migration
{

    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('navs', function (Blueprint $table) {
            $table->engine = 'InnoDB';
            $table->integer('id', true)->comment('id');
            $table->integer('parent_id')->comment('父级分类ID');
            $table->integer('type_id')->comment('导航分类');
            $table->string('name', 100)->comment('导航名称');
            $table->string('url', 100)->default('')->comment('导航地址');
            $table->string('icon', 20)->default('')->comment('使用的图标');
            $table->string('target', 10)->default('_self')->comment('打开方式');
            $table->boolean('status')->default(1)->comment('状态 1 启用 2 停用');
            $table->smallInteger('sort')->default(100)->comment('排序');
            $table->timestamps();
            $table->index('type_id');
        });
    }


    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::drop('navs');
    }

}
